<!DOCTYPE HTML>
<html lang="zh-CN" class="ax-vertical-centered" xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="UTF-8">
    <title>图书馆管理系统</title>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <link rel="stylesheet" th:href="@{/css/bootstrap.min.css}">
    <link rel="stylesheet" th:href="@{/css/bootstrap-theme.min.css}">
    <link rel="stylesheet" th:href="@{/css/bootstrap-admin-theme.css}">
    <link rel="stylesheet" th:href="@{/css/bootstrap-admin-theme.css}">
    <script th:src="@{/jQuery/jquery-3.1.1.min.js}"></script>
    <script th:src="@{/js/bootstrap.min.js}"></script>
    <script th:src="@{/js/bootstrap-dropdown.min.js}"></script>
    <script th:src="@{/js/addBookType.js}"></script>


</head>


<script src="../js/jquery.min.js"></script>
<script src="../static/js/bootstrap.min.js"></script>


<body class="bootstrap-admin-with-small-navbar">
<nav class="navbar navbar-inverse navbar-fixed-top bootstrap-admin-navbar bootstrap-admin-navbar-under-small"
     role="navigation">
    <div class="container">
        <div class="row">
            <div class="col-lg-12">
                <div class="collapse navbar-collapse main-navbar-collapse">
                    <a class="navbar-brand" href="/manage/home"><strong>欢迎使用教室资源管理系统</strong></a>
                    <ul class="nav navbar-nav navbar-right">
                        <li class="dropdown">
                            <a href="#" role="button" class="dropdown-toggle" data-hover="dropdown">
                                <i class="glyphicon glyphicon-user"></i> 欢迎您，<span th:text="${session.admin.username}"></span>
                                <i class="caret"></i></a>

                            <ul class="dropdown-menu">
                                <li><a href="#updateinfo" data-toggle="modal">个人资料</a></li>
                                <li role="presentation" class="divider"></li>
                                <li><a href="#updatepwd" data-toggle="modal">修改密码</a></li>
                                <li role="presentation" class="divider"></li>
                                <li><a href="/admin/quit">退出</a></li>
                            </ul>

                        </li>
                    </ul>
                </div>
            </div>
        </div>
    </div>
</nav>
<input type="hidden" th:value="${msg}" id="msg"/>
<div class="container">
    <div class="row">
        <div class="col-md-2 bootstrap-admin-col-left">
            <ul class="nav navbar-collapse collapse bootstrap-admin-navbar-side">
                <li>
                    <a href="/manage/bookManage"><i
                            class="glyphicon glyphicon-chevron-right"></i> 图书管理</a>
                </li>
                <li>
                    <a href="/manage/bookTypeManage"><i
                            class="glyphicon glyphicon-chevron-right"></i> 图书分类管理</a>
                </li>


                <li>
                    <a href="/manage/borrowSearch"><i
                            class="glyphicon glyphicon-chevron-right"></i> 借阅查询</a>
                </li>


                <li>
                    <a href="/manage/adminManage"><i
                            class="glyphicon glyphicon-chevron-right"></i> 管理员管理</a>
                </li>

                <li>
                    <a href="/manage/readerManage"><i
                            class="glyphicon glyphicon-chevron-right"></i> 读者管理</a>
                </li>





            </ul>
        </div>

        <div class="col-md-10">
            <div class="row">
                <div class="col-lg-12">
                    <div class="panel panel-default bootstrap-admin-no-table-panel">
                        <div class="panel-heading">
                            <div class="text-muted bootstrap-admin-box-title">查询</div>
                        </div>
                        <div class="bootstrap-admin-no-table-panel-content bootstrap-admin-panel-content collapse in">
                            <form class="form-horizontal" action="/order/get_order"
                                  method="post">


                                <div class="col-lg-5 form-group">
                                    <label class="col-lg-4 control-label" >用户账号</label>
                                    <div class="col-lg-8">
                                        <input class="form-control"  type="text"
                                               name="id">
                                        <label class="control-label"  style="display: none;"></label>
                                    </div>
                                </div>
                                <div class="col-lg-2 form-group">
                                    <button type="submit" class="btn btn-primary"  >查询
                                    </button>

                                </div>
                            </form>
                            <form class="form-horizontal" action="/order/get_order2"
                                      method="post">
                                <div class="col-lg-5 form-group">
                                    <label class="col-lg-4 control-label" >教室号</label>
                                    <div class="col-lg-8">
                                        <input class="form-control"  type="text" id=""
                                               name="id">
                                        <label class="control-label"  style="display: none;"></label>
                                    </div>
                                </div>
                                <div class="col-lg-5 form-group">
                                    <label class="col-lg-4 control-label" >教室区域</label>
                                    <div class="col-lg-8">
                                        <select class="form-control"   name="area">
                                            <option value="" th:text="所有区域"></option>
                                            <option value="1" th:text="南区"></option>
                                            <option value="2" th:text="北区"></option>
                                        </select>
                                    </div>
                                </div>
                                <div class="col-lg-5 form-group">
                                    <label class="col-lg-4 control-label" >教室类型</label>
                                    <div class="col-lg-8">
                                        <select class="form-control" id="time" name="type">
                                            <option value="" th:text="所有类型"></option>
                                            <option value="1" th:text="自习室"></option>
                                            <option value="2" th:text="活动室"></option>
                                        </select>
                                    </div>
                                </div>
                                <div class="col-lg-2 form-group">
                                    <button type="submit" class="btn btn-primary" >查询
                                    </button>

                                </div>
                                <br>
                            </form>
                                <form class="form-horizontal" action="/bookType/bookType_select"
                                      method="post">
                                <div class="col-lg-4 form-group">
                                    <label class="col-lg-4 control-label" >教室号</label>
                                    <div class="col-lg-4">
                                        <input class="form-control"  type="text" id="id"
                                               name="typeName">
                                        <label class="control-label"  style="display: none;"></label>
                                    </div>

                                </div>
                                <div class="col-lg-2 form-group">
                                    <button type="submit" class="btn btn-primary" id="btn_query" >誊清教室
                                    </button>

                                </div>
                            </form>
                        </div>
                    </div>
                </div>
            </div>
            <div class="row">
                <div class="col-lg-12">
                    <table id="data_list" class="table table-hover table-bordered" cellspacing="0" width="100%">
                        <thead>
                        <tr>
                            <th>用户账号</th>
                            <th>用户名</th>
                            <th>教室名</th>
                            <th>教室区域</th>
                            <th>教室类型</th>
                            <th>座位号</th>
                            <th>时间段</th>
                        </tr>
                        </thead>

                        <tbody th:if="${classrooms != null}" th:each="room,iterStat:${classrooms}" >
                        <td th:text="${users[iterStat.index].id}">

                        </td>
                        <td th:text="${users[iterStat.index].name}">

                        </td>
                        <td th:text="${room.id}">

                        </td>
                        <td th:if="${room.area}==1" >
                            北区
                        </td>
                        <td th:if="${room.area}==2" >
                            南区
                        </td>
                        <td th:if="${room.type}==1" >
                            自习室
                        </td>
                        <td th:if="${room.type}==2" >
                            活动室
                        </td>
                        <td th:text="${orders[iterStat.index].index}">

                        </td>
                        <td th:if="${orders[iterStat.index].time}==1">
                            上午一二节课
                        </td>
                        <td th:if="${orders[iterStat.index].time}==2">
                            上午三四节课
                        </td>
                        <td th:if="${orders[iterStat.index].time}==3">
                            下午一二节课
                        </td>
                        <td th:if="${orders[iterStat.index].time}==4">
                            下午三四节课
                        </td>

                        </tbody>

                        <tbody th:if="${maps != null}" th:each="map:${maps}" >
                        <td th:text="${map.sid}">

                        </td>
                        <td th:text="${map.name}">

                        </td>
                        <td th:text="${map.id}">

                        </td>
                        <td th:if="${map.area}==1" >
                            北区
                        </td>
                        <td th:if="${map.area}==2" >
                            南区
                        </td>
                        <td th:if="${map.type}==1" >
                            自习室
                        </td>
                        <td th:if="${map.type}==2" >
                            活动室
                        </td>
                        <td th:text="${map.i}">

                        </td>
                        <td th:if="${map.time}==1">
                            上午一二节课
                        </td>
                        <td th:if="${map.time}==2">
                            上午三四节课
                        </td>
                        <td th:if="${map.time}==3">
                            下午一二节课
                        </td>
                        <td th:if="${map.time}==4">
                            下午三四节课
                        </td>

                        </tbody>
<!--                         <tbody>-->
<!--                        <td>2021517101</td>-->
<!--                        <td>张三</td>-->
<!--                        <td>105</td>-->
<!--                        <td>南区</td>-->
<!--                        <td>自习室</td>-->
<!--                        <td>20</td>-->
<!--                        <td>上午一二节课</td>-->

<!--                        </tbody>-->
<!--                        <tbody>-->
<!--                        <td>2021517102</td>-->
<!--                        <td>王四</td>-->
<!--                        <td>106</td>-->
<!--                        <td>南区</td>-->
<!--                        <td>活动室</td>-->
<!--                        <td>1</td>-->
<!--                        <td>上午三四节课</td>-->

<!--                        </tbody>-->

                    </table>


                </div>
            </div>
        </div>
    </div>
</div>


<!--------------------------------------添加的模糊框------------------------>
<form class="form-horizontal" action="/bookType/bookType_insert">
    <!-- 模态框（Modal） -->
    <div class="modal fade" id="addModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
        <div class="modal-dialog">
            <div class="modal-content">
                <div class="modal-header">
                    <button type="button" class="close" data-dismiss="modal" aria-hidden="true">
                        &times;
                    </button>
                    <h4 class="modal-title" id="myModalLabel">
                        添加图书分类
                    </h4>
                </div>
                <div class="modal-body">

                    <!---------------------表单-------------------->
                    <div class="form-group">
                        <label  class="col-sm-3 control-label">图书分类名称</label>
                        <div class="col-sm-7">
                            <input type="text" class="form-control" name="typeName" id="addBookTypeName" placeholder="请输入图书分类名称">
                            <label class="control-label" for="addBookTypeName" style="display: none;"></label>
                        </div>
                    </div>

                    <!---------------------表单-------------------->
                </div>
                <div class="modal-footer">
                    <button type="button" class="btn btn-default" data-dismiss="modal">关闭
                    </button>
                    <button type="submit" class="btn btn-primary" id="addBookType">
                        添加
                    </button>
                </div>
            </div><!-- /.modal-content -->
        </div><!-- /.modal -->
    </div>

</form>
<!--------------------------------------添加的模糊框------------------------>




<!-- 修改模态框（Modal） -->
<form class="form-horizontal" action="/bookType/bookType_update">   <!--保证样式水平不混乱-->
    <div class="modal fade" id="updateModal" tabindex="-1" role="dialog" aria-labelledby="updateModalLabel"
         aria-hidden="true">
        <div class="modal-dialog">
            <div class="modal-content">
                <div class="modal-header">
                    <button type="button" class="close" data-dismiss="modal" aria-hidden="true">
                        &times;
                    </button>
                    <h4 class="modal-title" id="updateModalLabel">
                        修改图书分类信息
                    </h4>
                </div>
                <div class="modal-body">

                    <!---------------------表单-------------------->
                    <input type="hidden" name= "typeId" id="addbookTypeId" value="" >
                    <div class="form-group">
                        <label  class="col-sm-3 control-label">图书分类名称</label>
                        <div class="col-sm-7">
                            <input type="hidden" id="updateBookTypeId">
                            <input type="text" class="form-control" name="typeName" id="updateBookTypeName" placeholder="请输入图书分类名称">
                            <label class="control-label" for="updateBookTypeName" style="display: none;"></label>
                        </div>
                    </div>


                    <!---------------------表单-------------------->

                </div>
                <div class="modal-footer">
                    <button type="button" class="btn btn-default" data-dismiss="modal">关闭
                    </button>
                    <button type="button" class="btn btn-primary" id="updateBookType">
                        修改
                    </button>
                </div>
            </div><!-- /.modal-content -->
        </div><!-- /.modal -->
    </div>

</form>
<!-------------------------------------------------------------->


<!------------------------------修改密码模糊框-------------------------------->

<form class="form-horizontal">   <!--保证样式水平不混乱-->
    <!-- 模态框（Modal） -->
    <div class="modal fade" id="updatepwd" tabindex="-1" role="dialog" aria-labelledby="myModalLabel"
         aria-hidden="true">
        <div class="modal-dialog">
            <div class="modal-content">
                <div class="modal-header">
                    <button type="button" class="close" data-dismiss="modal" aria-hidden="true">
                        &times;
                    </button>
                    <h4 class="modal-title" id="myModalLabel">
                        修改密码
                    </h4>
                </div>

                <div class="modal-body">

                    <!--正文-->
                    <div class="form-group">
                        <label  class="col-sm-3 control-label">原密码</label>
                        <div class="col-sm-7">
                            <input type="password" class="form-control" id="oldPwd" placeholder="请输入原密码">
                            <label class="control-label" for="oldPwd" style="display: none;"></label>
                        </div>
                    </div>

                    <div class="form-group">
                        <label  class="col-sm-3 control-label">新密码</label>
                        <div class="col-sm-7">
                            <input type="password" class="form-control" id="newPwd" placeholder="请输入新密码">
                            <label class="control-label" for="newPwd" style="display: none;"></label>
                        </div>
                    </div>

                    <div class="form-group">
                        <label  class="col-sm-3 control-label">确认密码</label>
                        <div class="col-sm-7">
                            <input type="password" class="form-control" id="confirmPwd" placeholder="请输入确认密码">
                            <label class="control-label" for="confirmPwd" style="display: none;"></label>
                        </div>
                    </div>
                    <!--正文-->


                </div>
                <div class="modal-footer">
                    <button type="button" class="btn btn-default" data-dismiss="modal">关闭
                    </button>
                    <button type="button" class="btn btn-primary" id="update_adminPwd">
                        修改
                    </button>
                </div>
            </div><!-- /.modal-content -->
        </div><!-- /.modal -->
    </div>

</form>
<!-------------------------------------------------------------->


<!-------------------------个人资料模糊框------------------------------------->

<form class="form-horizontal">   <!--保证样式水平不混乱-->
    <!-- 模态框（Modal） -->
    <div class="modal fade" id="updateinfo" tabindex="-1" role="dialog" aria-labelledby="ModalLabel" aria-hidden="true">
        <div class="modal-dialog">
            <div class="modal-content">
                <div class="modal-header">
                    <button type="button" class="close" data-dismiss="modal" aria-hidden="true">
                        &times;
                    </button>
                    <h4 class="modal-title" id="ModalLabel">
                        个人资料
                    </h4>
                </div>

                <div class="modal-body">

                    <!--正文-->
                    <div class="form-group">
                        <label class="col-sm-3 control-label">用户名</label>
                        <div class="col-sm-7">
                            <input type="text" class="form-control" id="username"
                                   th:value='${session.admin.username}'>
                            <label class="control-label" for="username" style="display: none;"></label>
                        </div>
                    </div>


                    <div class="form-group">
                        <label class="col-sm-3 control-label">真实姓名</label>
                        <div class="col-sm-7">
                            <input type="text" class="form-control" id="name" placeholder="请输入您的真实姓名"
                                   th:value="${session.admin.name}">
                            <label class="control-label" for="name" style="display: none;"></label>
                        </div>
                    </div>

                    <div class="form-group">
                        <label class="col-sm-3 control-label">联系号码</label>
                        <div class="col-sm-7">
                            <input type="text" class="form-control" id="phone" placeholder="请输入您的联系号码"
                                   th:value="${session.admin.phone}" >
                            <label class="control-label" for="phone" style="display: none;"></label>

                        </div>
                    </div>

                    <!--正文-->


                </div>
                <div class="modal-footer">
                    <button type="button" class="btn btn-default" data-dismiss="modal">关闭
                    </button>
                    <button type="button" class="btn btn-primary" id="admin_updateInfo">
                        修改
                    </button>
                </div>
            </div><!-- /.modal-content -->
        </div><!-- /.modal -->
    </div>

</form>
<!-------------------------------------------------------------->


<div class="modal fade" id="modal_info" tabindex="-1" role="dialog" aria-labelledby="addModalLabel">
    <div class="modal-dialog" role="document">
        <div class="modal-content">
            <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span>
                </button>
                <h4 class="modal-title" id="infoModalLabel">提示</h4>
            </div>
            <div class="modal-body">
                <div class="row">
                    <div class="col-lg-12" id="div_info"></div>
                </div>
            </div>
            <div class="modal-footer">
                <button type="button" class="btn btn-default" id="btn_info_close" data-dismiss="modal">关闭</button>
            </div>
        </div>
    </div>
</div>


</body>
</html>
